<?php
/**
 * Created by 张彪.
 * User: 小马出行
 * Date: 2018/1/11
 * Time: 11:18
 */
namespace app\inter\model;
use \think\Model;
use think\Db;
class DriverCodeModel extends Model
{
    public function getCodeRecode($map,$field='*',$flag=true,$limit=10)
    {

        return $flag?Db::name('driver_code')->where($map)->field($field)->limit($limit)->select()
            :Db::name('driver_code')->where($map)->field($field)->find();
    }

    public function addCode($data)
    {
        return Db::name('driver_code')->insertGetId($data);
    }

    public function updateCode($map,$data)
    {
        return Db::name('driver_code')->where($map)->update($data);
    }
}